﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ucc="clr-namespace:BookReader"
>

    <!-- Toggle button-->
    <Style x:Key="GridSplitterExpanderHorizontalButton" TargetType="{x:Type ToggleButton}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToggleButton}">
                    <Grid Width="18" Height="18">
                        <Rectangle Margin="1" RadiusX="2" RadiusY="2"
                                   HorizontalAlignment="Stretch" VerticalAlignment="Stretch" 
                                   Fill="{DynamicResource PressedBorderBrush}" StrokeThickness="0" />
                        <Path Visibility="Collapsed" HorizontalAlignment="Center" x:Name="Down_Arrow" VerticalAlignment="Center" Fill="{DynamicResource GlyphBrush}" Data="M 0 0 L 4 4 L 8 0 Z" />
                        <Path HorizontalAlignment="Center" x:Name="Up_Arrow" VerticalAlignment="Center" Fill="{DynamicResource GlyphBrush}" Data="M 0 4 L 4 0 L 8 4 Z" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="true">
                            <Setter Property="Visibility" TargetName="Down_Arrow" Value="Visible" />
                            <Setter Property="Visibility" TargetName="Up_Arrow" Value="Collapsed" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="GridSplitterExpanderVerticalButton" TargetType="{x:Type ToggleButton}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToggleButton}">
                    <Grid Width="18" Height="18">
                        <Grid.LayoutTransform>
                            <TransformGroup>
                                <TransformGroup.Children>
                                    <TransformCollection>
                                        <RotateTransform Angle="-90" />
                                    </TransformCollection>
                                </TransformGroup.Children>
                            </TransformGroup>
                        </Grid.LayoutTransform>
                        <Rectangle RadiusX="2" RadiusY="2" Margin="1"
                                   HorizontalAlignment="Stretch" VerticalAlignment="Stretch" 
                                   Fill="{DynamicResource PressedBorderBrush}" StrokeThickness="0" />
                        <Path Visibility="Collapsed" HorizontalAlignment="Center" x:Name="Down_Arrow" VerticalAlignment="Center" Fill="{DynamicResource GlyphBrush}" Data="M 0 0 L 4 4 L 8 0 Z" />
                        <Path HorizontalAlignment="Center" x:Name="Up_Arrow" VerticalAlignment="Center" Fill="{DynamicResource GlyphBrush}" Data="M 0 4 L 4 0 L 8 4 Z" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="true">
                            <Setter Property="Visibility" TargetName="Down_Arrow" Value="Visible" />
                            <Setter Property="Visibility" TargetName="Up_Arrow" Value="Collapsed" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>